//
//  LYCommentCell.m
//  artist
//
//  Created by Jay_Apple on 16/5/13.
//  Copyright © 2016年 viviyoo. All rights reserved.
//

#import "LYCommentCell.h"
#import "LYCommentListModel.h"
#import "NSDate+Utils.h"
@interface LYCommentCell ()

@property (weak, nonatomic) IBOutlet UILabel *name;

@property (weak, nonatomic) IBOutlet UILabel *time;

@property (weak, nonatomic) IBOutlet UILabel *content;

@property (weak, nonatomic) IBOutlet UIImageView *icon;

@end

@implementation LYCommentCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)setModel:(LYCommentListModel *)model{

    _model = model;
    
    [self.icon setHeader:_model.from_head_pic];
    
    //回复用户信息
    NSString *nameTitle = (_model.to_user_id.length > 0) ? [NSString stringWithFormat:@"%@ 回复 %@",_model.from_nick_name,_model.to_nick_name] : _model.from_nick_name;
    
    self.name.text = nameTitle;
    //时间
    NSDate *date = [NSDate dateFromTimeStampString:_model.create_time];
    self.time.text = [date string];
    
    //内容
    self.content.text = _model.content;
}


@end
